package cn.ac.sec.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.ac.sec.model.User;
import cn.ac.sec.service.UserService;

@RestController
public class TestController {
	
	@Autowired
	private UserService userService;
	
	@GetMapping("/hello")
	public String index() {
		return "hello world！！！";
	}
	
	@GetMapping("/getUserByUserName")
	public User getUserByUserName(String userName) {
		User user = userService.getUserByUserName(userName);
		return user;
	}
	
}
